from redis import StrictRedis


class Config:
    DEBUG = None
    SECRET_KEY = 'qAmzgRXYk/EfCsIF3awppQUpilfwcTW17PpS8ZAJzdgh+laKRdrCmQ=='
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@127.0.0.1:3306/python6'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SESSION_TYPE = 'redis'
    SESSION_REDIS = StrictRedis(host='127.0.0.1', port=6379)  # 制定session连接到制定数据库
    SESSION_USE_SIGNER = True  # 对session签名 不签名需要密钥
    PERMANENT_SESSION_LIFETIME = 86400


class developmentConfig(Config):
    DEBUG = True


class productionConfig(Config):
    DEBUG = False


config = {
    'development': developmentConfig,
    'production': productionConfig
}
